 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"
	language="java"%>
<%@ include file="/jsp/platform/include/include.jsp"%>
<%@page import="com.zx.map.service.model.MerchantInfoModel"%>
<LINK href="style/indexstyle.css" rel="stylesheet" type="text/css">
<LINK href="style/downpop.css" rel="stylesheet" type="text/css">
<LINK href="style/popcenter.css" rel="stylesheet" type="text/css"> 
<LINK href="style/easyui.css" rel="stylesheet" type="text/css">      
<SCRIPT src="script/jquery-1.4.2.js" type="text/javascript"></SCRIPT>
     
<SCRIPT src="script/JSUnit.js" type="text/javascript"></SCRIPT>
<SCRIPT src="script/all.js" type="text/javascript"></SCRIPT>
<SCRIPT src="script/common.js" type="text/javascript"></SCRIPT>
<SCRIPT src="script/passGuardCtrl.js" type="text/javascript"></SCRIPT>
<SCRIPT src="script/jquery.easyui.min.js" type="text/javascript"></SCRIPT>
<SCRIPT src="script/kkpager.js" type="text/javascript"></SCRIPT>
<SCRIPT src="script/kkpager.js" type="text/javascript"></SCRIPT>
<SCRIPT src="<%=request.getContextPath()%>/script/zDialog.js" type="text/javascript"></SCRIPT>
<SCRIPT src="<%=request.getContextPath()%>/script/zDialogIndex.js" type="text/javascript"></SCRIPT>
<%@page import="java.util.List"%>
 <%
 List<MerchantInfoModel> merchantInfoModelList = (List<MerchantInfoModel>)request.getAttribute("list"); 
 System.out.println("xxxxx"+merchantInfoModelList.size());
 %>
<html>
<head>
<TITLE><c:out value="${_LOGONUSER_.MANAGETITILE}" /></TITLE>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<%@ include file="/jsp/platform/include/header.jsp"%>
</HEAD>
<BODY>
	<DIV class="all">
		5<%@ include file="/jsp/platform/include/head.jsp"%>
		<%@ include file="/jsp/platform/include/menu.jsp"%>
		<DIV class="mains">
			<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
				<TBODY>
					<TR valign="top">
						<%@ include file="/jsp/platform/include/mainLeft.jsp"%>
						<TD>
							<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
								<TBODY>
									<TR>
										<TD>
											<TABLE width="180" border="0" cellspacing="0" cellpadding="0">
												<TBODY>
													<TR>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_l.jpg">
														</TD>
														<TD align="center"
															background="<%=request.getContextPath()%>/images/pages_bg.jpg">
															<SPAN class="f_tit1">操作员管理</SPAN></TD>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_r.jpg">
														</TD>
													</TR>
												</TBODY>
											</TABLE></TD>
									</TR>
								</TBODY>
								<TR>
									<TD>
										<div class="pages_con">
											<!--创建页面-->

								                    <div class="pages_con_20">
                         <form action="<%=request.getContextPath()%>/manage/merchantInfo/queryMerchantInfoList" method="post" name="queryMerchantInfoForm" id="queryMerchantInfoForm">
                                <div class="transaction_external">
                                <DIV class="clearfix" ><SPAN class="label dl_w" style="padding-left:20px;text-align:right;">申请日期：</SPAN>         
                                    <DIV class="select2 date">
                                    <INPUT name="beginDate" class="easyui-datebox" id="begindate" style="border:none" type="text" data-options="formatter:myformatter,parser:myparser" >
                                    </DIV>
									<SPAN class="label margin_l_5">-</SPAN>         
                                    <DIV class="select2 date">
                                    <INPUT name="endDate" class="easyui-datebox" id="enddate" style="border:none"type="text"data-options="formatter:myformatter,parser:myparser">									
                                    </DIV>
									<SPAN 
                                    class="label dl_w" style="padding-left:20px;"><SELECT 
                                      name="transStat"><OPTION value="">审核状态</OPTION>				 <OPTION 
                                      value="I">未审核</OPTION>				 <OPTION value="S">异常</OPTION>		 </SELECT> 
                                    </SPAN>
								</DIV>  

                                <DIV class="clearfix">
								<SPAN class="fund-item"><SPAN 
                                    class="label dl_w" style="padding-left:20px;text-align:right;">商户名称：</SPAN>           
									<INPUT name="merchantName" class="txtbox_cz txtbox_cz_long txtbox_cz_color input_change" type="text" maxlength="30"> 
									<SPAN class="fund-item"><SPAN 
                                    class="label dl_w" style="padding-left:20px;text-align:right;">代理商编号：</SPAN>          
									<INPUT name="sysAccount" class="txtbox_cz txtbox_cz_long txtbox_cz_color input_change" type="text" maxlength="30"> 
									
                                    <SPAN class="fund-item">
                                              <A class="btn confirm margin_l_10" onClick="$('#queryMerchantInfoForm').submit();" href="javascript:void(0);">查询</A> 
                                            </SPAN></SPAN></SPAN></DIV>
        					</DIV>
</FORM>   
                        <br>
                        <div class="talbes">
                            
                                    <table style="text-align: center" width="100%" border="0" cellpadding="8" cellspacing="0">
                                        <tbody><tr class="talbe_pubs_tr">
                                            <td>
                                                申请时间
                                            </td>
											<td>
                                                商户名称
                                            </td>
                                            <td>
                                                商户法人
                                            </td>
                                            <td>
                                                开户行
                                            </td>
                                            <td>
                                                所属区域
                                            </td>
                                            
                                            <td>
                                                所属代理商
                                            </td>  
											<td>
                                                微信结算费率
                                            </td>
											<td>
                                                支付宝结算费率
                                            </td>
											<td>
                                                审核状态
                                            </td>
											<td>
                                                操作
                                            </td>
                                        </tr>
                                 <c:forEach var="list" items="${list}">
                                    <tr>
                                        <td>
                                            <fmt:formatDate value="${list.createDate}"
                                                                            pattern="yyyy-MM-dd HH:mm:ss"/>
                                        </td>

                                        <td>
                                           <c:out  value="${list.merchantName}"/>
                                        </td>
										<td>
                                            <c:out  value="${list.legalIdentityno}"/>
                                        </td>
										<td>
                                           <c:out  value="${list.depositBank}"/>
                                        </td>

                                        <td>
                                            <c:out  value="${list.merchantProvince}"/>
                                        </td>
                                        <td>
                                            <c:out  value="${list.settleId}"/>
                                        </td>
                                            
											<td>
                                                <c:out  value="${list.wxRate}"/>%
                                            </td>
											<td>
                                                <c:out  value="${list.alipayRate}"/>%
                                            </td>
											<td>
														<c:if test="${list.status=='0'}" var="name1">
                                                         	审核拒绝
                                                         </c:if>
                                                          <c:if test="${list.status=='1'}" var="name1">
															审核通过
                                                         </c:if>
                                                         <c:if test="${list.status==''}" var="name1">
                                                         	未审批
                                                         </c:if>
                                            </td>
											<td>
											   <A   href="javascript:void(0);"
												onclick="confirmSpStatus('${list.merchantId}','1')">审核通过</A>
											   <A   href="javascript:void(0);"
												onclick="confirmSpStatus('${list.merchantId}','0')">审核拒绝</A>
											   <A   href="javascript:void(0);"
												onclick="viewMerchantInfo('${list.merchantId}')">详情</A>		
                                            </td>
                                    </tr>
                                   </c:forEach>
								   
                                    </tbody></table>
                                
                        </div>
                        <div id="kkpager"></div>
                    </div>
                </div>
                
                                      <!--当中内容块结束-->
                             </TD>
                             </TR>   
								<!--结束-->
							</TABLE></TD>
					</TR>
				</TBODY>
			</TABLE>
		</DIV>
		<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
			<TBODY>
				<TR>
					<TD width="5" bgcolor="#f1fcfe"><IMG width="5" height="5"
						src="<%=request.getContextPath()%>/images/footer_l.jpg">
					</TD>
					<TD bgcolor="#f1fcfe">&nbsp; <br />
					</TD>
					<TD width="5" bgcolor="#f1fcfe"><IMG width="5" height="5"
						src="<%=request.getContextPath()%>/images/footer_r.jpg">
					</TD>
				</TR>
			</TBODY>
		</TABLE>
		<%@ include file="/jsp/platform/include/foot.jsp"%>
</BODY>
</HTML>
<script type="text/javascript">
function getParameter(name) { 
	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r!=null) return unescape(r[2]); return null;
}

//init
$(function(){
	var totalPage = 20;
	var totalRecords = 390;
	var pageNo = getParameter('pno');
	if(!pageNo){
		pageNo = 1;
	}
	//生成分页
	//有些参数是可选的，比如lang，若不传有默认值
	kkpager.generPageHtml({
		pno : pageNo,
		//总页码
		total : totalPage,
		//总数据条数
		totalRecords : totalRecords,
		//链接前部
		hrefFormer : 'orderQuery',
		//链接尾部
		hrefLatter : '.html',
		getLink : function(n){
			return this.hrefFormer + this.hrefLatter + "?pno="+n;
		}

	});
});


function confirmSpStatus(merchantId,applySatus) {
	var msg="";
	if(applySatus=='0'){
			msg="确定拒绝申请";
	}
	if(applySatus=='1'){
			msg="确定同意申请";
	}
	$.messager.confirm('确认', msg, 
			function(r){
						if (r)
						{  
							replyMerchantInfo(merchantId,applySatus)
						} 
					}
			);
}
function replyMerchantInfo(merchantId,applySatus) {
		var applyContent="";
		if(applySatus=='0'){
				$.messager.prompt('审批意见：', 
						'请输入审批意见', 
					   function(r)
					   {	
						   if (r){ 
								summitSpMerchantInfo(merchantId,applySatus,r)
							   }
						}
				); 
		}else{
			summitSpMerchantInfo(merchantId,applySatus,'')
		}
}
function summitSpMerchantInfo(merchantId,applySatus,content){
		var url = "<%=request.getContextPath()%>/manage/merchantInfo/replyMerchantInfo?merchantId="+merchantId+"&applySatus="+applySatus+"&content="+content;
		$.ajax({
			async : false,
			type : "POST",
			url : url,
			dataType : 'json',
			success : function(json) {
				if(json.state == "1") {
					$.messager.alert("提示信息", "成功");
				}else if(json.state == "0") {
					$.messager.alert("提示信息", "失败");
				}
				window.location.href=window.location.href;
			}
		});
}


function myformatter(date) {
	var y = date.getFullYear();
	var m = date.getMonth() + 1;
	var d = date.getDate();
	return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
}
function myparser(s) {
	if (!s)
	return new Date();
	var ss = (s.split('-'));
	var y = parseInt(ss[0], 10);
	var m = parseInt(ss[1], 10);
	var d = parseInt(ss[2], 10);
	if (!isNaN(y) && !isNaN(m) && !isNaN(d)) {
		return new Date(y, m - 1, d);
	} else {
		return new Date();
	}
}
function setDate(){
	$("#begindate").datebox('setValue','2015-01-02');
	$("#enddate").datebox('setValue','2015-01-02');
}


function viewMerchantInfo(merchantId) {
		var url = "<%=request.getContextPath()%>/manage/merchantInfo/viewMerchantInfo?merchantId="+merchantId;
		var diag = new Dialog();
		diag.Width = 1000;
		diag.Height =768;
		diag.Title = "详情";
		diag.URL = url;
		diag.show();
}
		
</script>
